/*
 * @Author: wusd
 * @Date: 2022-06-15 09:39:58
 * @LastEditors: wusd
 * @LastEditTime: 2022-06-15 11:25:57
 * @Description:
 *
 */
import stroage from '@/untils/stroage'
export default {
  state: {
    token: '',
    userInfo: null
  },
  mutations: {
    setToken(state: { token: any }, val: string) {
      state.token = val
      stroage.set('token', val)
    },
    getToken(state: { token: string | undefined }) {
      state.token = stroage.get('token')
    },
    setUserInfo(state: { userInfo: any; token: string | undefined }, val: any) {
      state.userInfo = val
      state.token = stroage.get('userInfo')
    }
  },
  actions: {}
}
